requirejs.config({
	urlArgs: 'v=1202'+Math.random(),
	baseUrl : '../js/libs',
	paths : {
		jquery : 'jquery.min',
		jquery_ext : 'jquery.ext',
        jquery_route : 'router',
        template:'template',
//		jquery_route : 'jquery.route',
        jquerycookie: 'jquery.cookie',
        layer: '../plugins/layer/layer',
		jquery_artmodel : "jquery.artmodel",
		jquery_qrcode : "jquery.qrcode.min",
		bootstrap : "../../bootstrap-3.3.5/dist/js/bootstrap.min",
		bootstrapselectbase: "../plugins/bootstrap-select/js/bootstrap-select",
		bootstrapselect:"../plugins/bootstrap-select/js/i18n/defaults-zh_CN",
		bootstrap_typeahead:"../plugins/bootstrap_typeahead/bootstrap3-typeahead",
		menu : "../modules/menu",
		config : "../common/config",
		common : "../common/common",
		account : "../common/account",
		login : "../common/login",
        pageJs: '../common/pageJs',
        stringUtil : "../common/string-util",
        bootstrap_paginator:'../plugins/bootstrap-paginator/bootstrap-paginator',
		arttemplateUtil : '../common/arttemplate-util',
        calendar1:'calendarpicker1',
        calendar:'calendarpicker',
		wdatePicker:"../plugins/My97DatePicker/WdatePicker",
        validform:"../plugins/Validform/Validform_v5.3.2",
        arttemplateUtil: '../common/arttemplate-util',
		main : "../modules/main",
		routerConfig : "../modules/routerConfig",
        md5: 'md5.min',
        echarts:"../plugins/echarts/echarts",
        echartsUtil:"../common/echarts-util",
        ztree:'../plugins/ztree/js/jquery.ztree.core',
        ztreeCheck:'../plugins/ztree/js/jquery.ztree.excheck.min',
        ztreeHide:'../plugins/ztree/js/jquery.ztree.exhide',
		cxselect : "../plugins/cxSelect/jquery.cxselect.min",
		"webuploader" : "../plugins/webuploader/js/webuploader",
		"customUploader_bath" : "../plugins/webuploader/js/customUploader_bath",
		"kindeditor" : "../plugins/editor/kindeditor",
		"kindeditor_lang" : "../plugins/editor/lang/zh_CN",
        stringUtil: "../common/string-util",
        uploadify : '../plugins/uploadify/jquery.uploadify',
        filer: '../plugins/fileinput/js/new/jquery.filer',

        familyController : "../modules/family/familyController"
	},
    waitSeconds : 5,
	map : {
		'*' : {
			'css' : 'css'
		}
	},
	shim : { //引入没有使用requirejs模块写法的类库。backbone依赖underscore
		'jquery' : {
			exports : '$'
		},
    	'layer': ['jquery'],		
    	bootstrap : [ 'jquery'],
        pageJs:['bootstrap_paginator'],
        'bootstrap_paginator':{
        	deps:['bootstrap'],
        	exports: 'bootstrp'
        },
        bootstrap_typeahead:['bootstrap'],
        config:['jquerycookie'],
        pageJs:['bootstrap_paginator'],
        'calendar':['jquery'],
        'calendar1':['jquery'],
		'bootstrapselectbase':['bootstrap'],
		'arttemplateUtil':['template'],
		'bootstrapselect':['bootstrapselectbase'],
		'validform':['jquery'],
		'area':['jquery'],
		'msg_util':['jquery'],
        'filter':['jquery'],
        'wdatePicker':['jquery'],
        'ztreeCheck':['css!../plugins/ztree/css/zTreeStyle/zTreeStyle.css'],
        'ztreeHide':['ztree'],
		'uploadify' : [ 'jquery',
				'css!../plugins/uploadify/uploadify.css' ],
		'customUploader_bath' : [
				'css!../plugins/webuploader/css/webuploader.css',
				'webuploader' ],
		'kindeditor_lang' : [
				'css!../plugins/editor/plugins/code/prettify.css',
				'kindeditor' ],
		echartsUtil:['echarts']
	}
});
require([ 'jquery','common','account','routerConfig','bootstrap'], function($,common,account,routerConfig) {
	//拦截所有a[href="#"] 点击跳转
	$(document).on('click','a[href="#"]',function(e){
		e.preventDefault();
	});
	var initPage = function(){
		var userInfo = account.userInfo;
		$('.dropdown-toggle span:first').html(userInfo.userName);
		//
		$('.dropdown-menu').on('click','a:first',function(e){
			e.preventDefault();
			$('#hangepwdmodal form')[0].reset();
			$('#hangepwdmodal .errinfo').removeClass('Validform_right').removeClass('Validform_wrong').html('');
			$('#hangepwdmodal').modal('show');
		});
		$('#hangepwdmodal').on('click','.btn-primary',function(e){
			e.preventDefault();
			account.changepwd();
		});
		// 退出
		$('.navbar-right .dropdown-menu').on('click','a:last',function(e){
			e.preventDefault();
			account.loginOut();
		});
	};
	initPage();
});